package com.dg.jwt;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

public class JWTTest2 {
    public static void main(String[] args) {
        long now = System.currentTimeMillis();
        long exp = now + 1000*60;
        JwtBuilder builder = Jwts.builder().setId("888").setSubject("小白").setIssuedAt(new Date())
                .signWith(SignatureAlgorithm.HS256,"itheima").setExpiration(new Date(exp));
        System.out.println(builder.compact());
    }
}
